perm filename WRITA[B2,JMC]1 blob sn#763048 filedate 1984-08-03 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00005 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	\chapter{WRITING RECURSIVE FUNCTION DEFINITIONS}
C00005 00003	\section{Static and dynamic ways of programming.}
C00011 00004	\section{Recursive definition of functions on natural numbers.}
C00014 00005	\section{Simple list recursion.}
C00023 ENDMK
CāŠ—;
\chapter{WRITING RECURSIVE FUNCTION DEFINITIONS}
\label{WRITIN}


	In \chapref{READIN} we discussed the basic constructs of 
\lisp\ and explained how \lisp\ evaluates terms built up from them.  
The notion of recursively defined function was introduced and the rules for 
computing the value of a recursively defined function were given.  
In addition we showed how \lisp\ programs are represented as S-expressions and 
how these programs are interpretered by the function /eval/.   
By now you should be able to read and understand simple \lisp\ programs.  
The next step is learning
to write \lisp\ programs.  In principle you already know all that is necessary,
however there are some basic ideas and  techniques which are 
useful in solving \lisp\ programming problems.  The purpose of
this chapter is to help you learn to think recursively and to familiarize
you with some of the basic techniques and
standard forms of recursive programs.  The final section contains 
a collection of
problems of varying degrees difficulty for you practice on.


\section{Static and dynamic ways of programming.}
\label{tdvsbu}

\section{Recursive definition of functions on natural numbers.}
\label{numrec}
\section{Simple list recursion.}
\label{listrec}
\section{Simple S-expression recursion.}
\label{sexprec}
\section{Other structural recursions.}
\label{strucrec}
\section{General tree recursion.}
\label{treerec}
\section{Non-structural recursions.}
\label{nonstruc}
\section{Solving a LISP programming problem.}
\label{soln}
\section{Lots of LISP functions to program.}
\label{writinex}